Light Dark System

Menu Label

<p-menu-label> | PMenuLabel
Since 1.0 stable

Menu labels are used to describe a group of menu items.

Fruits Apple Banana Orange Vegetables Broccoli Carrot Zucchini
<p-menu style="max-width: 200px;">
  <p-menu-label>Fruits</p-menu-label>
  <p-menu-item value="apple">Apple</p-menu-item>
  <p-menu-item value="banana">Banana</p-menu-item>
  <p-menu-item value="orange">Orange</p-menu-item>
  <p-divider></p-divider>
  <p-menu-label>Vegetables</p-menu-label>
  <p-menu-item value="broccoli">Broccoli</p-menu-item>
  <p-menu-item value="carrot">Carrot</p-menu-item>
  <p-menu-item value="zucchini">Zucchini</p-menu-item>
</p-menu>
import PDivider from 'pure-uikit/dist/react/divider';
import PMenu from 'pure-uikit/dist/react/menu';
import PMenuLabel from 'pure-uikit/dist/react/menu-label';
import PMenuItem from 'pure-uikit/dist/react/menu-item';

const App = () => (
  <PMenu style={{ maxWidth: '200px' }}>
    <PMenuLabel>Fruits</PMenuLabel>
    <PMenuItem value="apple">Apple</PMenuItem>
    <PMenuItem value="banana">Banana</PMenuItem>
    <PMenuItem value="orange">Orange</PMenuItem>
    <PDivider />
    <PMenuLabel>Vegetables</PMenuLabel>
    <PMenuItem value="broccoli">Broccoli</PMenuItem>
    <PMenuItem value="carrot">Carrot</PMenuItem>
    <PMenuItem value="zucchini">Zucchini</PMenuItem>
  </PMenu>
);

Importing

If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.

Script Import Bundler React

To import this component from the CDN using a script tag:

<script type="module" src="https://cdn.jsdelivr.net/npm/pure-uikit@1.3.13/cdn/components/menu-label/menu-label.js"></script>

To import this component from the CDN using a JavaScript import:

import 'https://cdn.jsdelivr.net/npm/pure-uikit@1.3.13/cdn/components/menu-label/menu-label.js';

To import this component using a bundler:

import 'pure-uikit/dist/components/menu-label/menu-label.js';

To import this component as a React component:

import PMenuLabel from 'pure-uikit/dist/react/menu-label';

Slots

Name Description
(default) The menu label’s content.

Learn more about using slots.

Parts

Name Description
base The component’s base wrapper.

Learn more about customizing CSS parts.