Arctic Design
Get StartedFoundationsComponentsExamples
K

List

Displays a List component with sections of ListItem containing title and description equally spaced

Usage
Cookie Settings
Manage your cookie settings here.
Strictly Necessary
These cookies are essential in order to use the website and use its features.
Functional Cookies
These cookies allow the website to provide personalized functionality.
Performance Cookies
These cookies help to improve the performance of the website.
import {
Button,
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
List,
ListItem,
ListItemDescription,
ListItemTitle,
Switch,
} from '@arctic-kit/snow';
import { useCallback, useState } from 'react';
type ChoiceType = 'strict' | 'functional' | 'performance';
function Demo() {
const [preferences, setPreferences] = useState<{ [key: string]: boolean }>({
strict: false,
functional: true,
performance: false,
});
const onChangeHandler = useCallback((choice: ChoiceType) => {
setPreferences((prevState) => ({
...prevState,
[choice]: !prevState[choice],
}));
}, []);
return (
<Card sx={{ maxWidth: 420 }}>
<CardHeader>
<CardTitle>Cookie Settings</CardTitle>
<CardDescription>Manage your cookie settings here.</CardDescription>
</CardHeader>
<CardContent>
<List >
<ListItem
suffix={
<Switch
checked={preferences.strict}
onToggle={() => onChangeHandler('strict')}
/>
}
>
<ListItemTitle>Strictly Necessary</ListItemTitle>
<ListItemDescription>
These cookies are essential in order to use the website and use
its features.
</ListItemDescription>
</ListItem>
<ListItem
suffix={
<Switch
checked={preferences.functional}
onToggle={() => onChangeHandler('functional')}
/>
}
>
<ListItemTitle>Functional Cookies</ListItemTitle>
<ListItemDescription>
These cookies allow the website to provide personalized
functionality.
</ListItemDescription>
</ListItem>
<ListItem
suffix={
<Switch
checked={preferences.performance}
onToggle={() => onChangeHandler('performance')}
/>
}
>
<ListItemTitle>Performance Cookies</ListItemTitle>
<ListItemDescription>
These cookies help to improve the performance of the website.
</ListItemDescription>
</ListItem>
</List>
</CardContent>
<CardFooter>
<Button style={{ width: '100%' }}>Save preferences</Button>
</CardFooter>
</Card>
);
}

API Reference

PropsTypeDefault
spacing0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 106