API Table
A reusable table component for displaying API documentation with consistent styling.
Usage
Component Props
The available props for this component.
| Property | Type | Default | Description |
|---|---|---|---|
| size | "sm" | "md" | "lg" | "md" | The size of the component. |
| variant | "default" | "ghost" | "default" | The visual style of the component. |
1import { ApiTable } from "aviris-components";23const properties = [4 {5 name: "size",6 type: '"sm" | "md" | "lg"',7 defaultValue: '"md"',8 description: "The size of the component.",9 },10 {11 name: "variant",12 type: '"default" | "ghost"',13 defaultValue: '"default"',14 description: "The visual style of the component.",15 },16];1718export default function ApiTableDemo() {19 return (20 <ApiTable21 title="Component Props"22 description="The available props for this component."23 properties={properties}24 />25 );26}Without Default Column
Use the showDefault prop to hide the Default column when displaying interface properties.
Interface Properties
| Property | Type | Description |
|---|---|---|
| icon | React.ReactNode | Required. The icon to display. |
| label | string | Required. The label text. |
1import { ApiTable } from "aviris-components";23const properties = [4 {5 name: "icon",6 type: "React.ReactNode",7 description: "Required. The icon to display.",8 },9 {10 name: "label",11 type: "string",12 description: "Required. The label text.",13 },14];1516export default function ApiTableDemo() {17 return (18 <ApiTable19 title="Interface Properties"20 properties={properties}21 showDefault={false}22 />23 );24}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | - | Optional title to display above the table. |
| description | string | - | Optional description text to display below the title. |
| properties | Property[] | - | Array of properties to display in the table. |
| showDefault | boolean | true | Whether to show the Default column. |
Property Definition
The shape of each property in the properties array.
| Property | Type | Description |
|---|---|---|
| name | string | Required. The name of the property. |
| type | string | Required. The type definition of the property. |
| defaultValue | string | Optional default value of the property. |
| description | string | Required. Description of the property. |