New to KendoReact? Learn about KendoReact Free.
DrawerContent
Represents the KendoReact Drawer component.
jsx
const App = () => {
const items = [
{ text: 'Inbox', icon: 'k-i-inbox', selected: true },
{ separator: true },
{ text: 'Notifications', icon: 'k-i-bell', disabled: true },
{ text: 'Calendar', icon: 'k-i-calendar' },
{ separator: true },
{ text: 'Attachments', icon: 'k-i-hyperlink-email' },
{ text: 'Favourites', icon: 'k-i-star-outline' }
];
const [expanded, setExpanded] = React.useState(true);
const handleClick = () => setExpanded(prevState => !prevState);
return (
<Drawer expanded={expanded} position='start' mode='push' items={items}>
<DrawerContent>
<button className="k-button" onClick={handleClick}>Toggle the drawer state</button>
</DrawerContent>
</Drawer>
);
};
ReactDOM.render(<App />, document.querySelector('my-app'));
Name | Type | Default | Description |
---|---|---|---|
props |
|
The props of the DrawerContent component. |