Prop Table

An expandable table for documenting component props.

Prop
Type
Default
import { PropTable, PropTableRow } from "@/components/ui/prop-table/prop-table";

export default function PropTableDemo() {
  return (
    <PropTable style={{ width: "100%" }}>
      <PropTableRow defaultValue='"primary"' name="variant" type='"primary" | "secondary" | "ghost"'>
        Visual style of the button.
      </PropTableRow>
      <PropTableRow defaultValue='"md"' name="size" type='"sm" | "md" | "lg"'>
        Size of the button.
      </PropTableRow>
      <PropTableRow defaultValue="false" name="disabled" type="boolean">
        Whether the button is disabled.
      </PropTableRow>
      <PropTableRow name="onClick" type="(event: MouseEvent) => void">
        Called when the button is clicked.
      </PropTableRow>
      <PropTableRow name="children" type="ReactNode">
        Content rendered inside the button.
      </PropTableRow>
    </PropTable>
  );
}

npx shadcn@latest add @roiui/prop-table
npx shadcn@latest add @roiui/prop-table-tailwind

anatomy
<PropTable>
  <PropTableRow name="size" type='"sm" | "md" | "lg"' defaultValue='"md"'>
      Size of the component.
  </PropTableRow>
</PropTable>

Renders the table header and wraps the rows. Accepts all section element props.

Prop
Type
Default