Skip to content

Commit

Permalink
[storybook] Add renderItem example
Browse files Browse the repository at this point in the history
- I keep forgetting storybooks!
  • Loading branch information
cee-chen committed Feb 7, 2024
1 parent 2ce3373 commit 2d7192b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/context_menu/context_menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { EuiPopover } from '../popover';
import { EuiButton } from '../button';
import { EuiIcon } from '../icon';
import { EuiTitle } from '../title';

import { EuiContextMenu, EuiContextMenuProps } from './context_menu';

Expand Down Expand Up @@ -95,6 +96,23 @@ const panels: EuiContextMenuProps['panels'] = [
icon: 'user',
panel: 2,
},
{
isSeparator: true,
},
{
renderItem: () => (
<EuiTitle
size="xxs"
css={({ euiTheme }) => ({
marginInline: euiTheme.size.s,
marginBlockStart: euiTheme.size.m,
marginBlockEnd: euiTheme.size.xs,
})}
>
<h3>Custom rendered subtitle</h3>
</EuiTitle>
),
},
{
name: 'Permalinks',
icon: 'user',
Expand Down

0 comments on commit 2d7192b

Please sign in to comment.