docs/developer_docs/components/ui/list.mdx
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
The List component from Superset's UI library.
<StoryWithControls component="List" props={{ bordered: false, split: true, size: "default", loading: false, dataSource: [ "Dashboard Analytics", "User Management", "Data Sources" ] }} controls={[ { name: "bordered", label: "Bordered", type: "boolean", description: "Whether to show a border around the list." }, { name: "split", label: "Split", type: "boolean", description: "Whether to show a divider between items." }, { name: "size", label: "Size", type: "select", options: [ "default", "small", "large" ], description: "Size of the list." }, { name: "loading", label: "Loading", type: "boolean", description: "Whether to show a loading indicator." } ]} />
Edit the code below to experiment with the component:
function Demo() {
const data = ['Dashboard Analytics', 'User Management', 'Data Sources'];
return (
<List
bordered
dataSource={data}
renderItem={(item) => <List.Item>{item}</List.Item>}
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
bordered | boolean | false | Whether to show a border around the list. |
split | boolean | true | Whether to show a divider between items. |
size | string | "default" | Size of the list. |
loading | boolean | false | Whether to show a loading indicator. |
dataSource | any | ["Dashboard Analytics","User Management","Data Sources"] | - |
import { List } from '@superset/components';
:::tip[Improve this page] This documentation is auto-generated from the component's Storybook story. Help improve it by editing the story file. :::