Components
Dropdown
Dropdowns are used to display a list of user-selectable actions or options
Selected Theme
Select brand or tribe name to preview style
Default
Usage
Dropdowns are used to display a list of user-selectable actions or options**
use of components don’t forget to add import legion-ui
import { Dropdown } from 'legion-ui';
Variant
Legion have a six variant of dropdown
Basic Dropdown
The default of dropdown is a basic dropdown
import React, { useState } from 'react';import { Dropdown, Button, DynamicIcon, Anchor } from 'legion-ui';import './style.css';const Example = () => {const [isOpen, setOpen] = useState(false);const toogle = () => setOpen((prev) => !prev);const onClose = () => setOpen(false);return (
.example-menu {display: flex;justify-content: center;align-items: center;}.example-menu-profile {text-align: left;line-height: 1.4;
Dropdown with Icon
You can modify the dropdown
with icon
import React, { useState } from 'react';import { Dropdown, Button, DynamicIcon, Anchor } from 'legion-ui';import './style.css';const Example = () => {const [isOpen, setOpen] = useState(false);const toogle = () => setOpen((prev) => !prev);const onClose = () => setOpen(false);
.example-menu {display: flex;justify-content: center;align-items: center;}.example-menu-profile {text-align: left;line-height: 1.4;
Dropdown with Description
You can modify the dropdown
with description
import React, { useState } from 'react';import { Dropdown, Button, DynamicIcon, Anchor } from 'legion-ui';import './style.scss';const ExampleThree = () => {const [isOpen, setOpen] = useState(false);const toogle = () => setOpen((prev) => !prev);const onClose = () => setOpen(false);return (
.example-menu {display: flex;justify-content: center;align-items: center;}.example-menu-profile {text-align: left;line-height: 1.4;
Dropdown with Checkbox
You can modify the dropdown
with checkbox
import React, { useState } from 'react';import { Dropdown, Button, DynamicIcon, Checkbox } from 'legion-ui';import './style.scss';const ExampleFour = () => {const [isOpen, setOpen] = useState(false);const toogle = () => setOpen((prev) => !prev);const onClose = () => setOpen(false);const clearSelected = () => setSelecdtedData([]);
.example-menu {display: flex;justify-content: center;align-items: center;}.example-menu-profile {text-align: left;line-height: 1.4;
Dropdown with Multiple Categories
You can modify the dropdown
with multiple categories
import React, { useState } from 'react'import { Dropdown, Button, DynamicIcon, Checkbox } from 'legion-ui'const ExampleFive = () => {const [isOpen, setOpen] = useState(false)const toogle = () => setOpen(prev => !prev)const onClose = () => setOpen(false)const clearSelected = () => setSelecdtedData([])
Dropdown with Toggle
You can modify the dropdown
with toggle
import React, { useState } from 'react';import { Dropdown, Avatar, DynamicIcon, Anchor, Button } from 'legion-ui';const ExampleSix = () => {const [isOpen, setOpen] = useState(false);const toogle = () => setOpen((prev) => !prev);const onClose = () => setOpen(false);return (
Props
property | propType | required | default | desc | ||
---|---|---|---|---|---|---|
borderRadius | number | - | - | Sets border dropdown radius | ||
boxShadow | string | - | 0 0 8px rgba(0, 0, 0, 0.125) | Sets shadow on dropdown | ||
children | React.ReactNode | yes | - | Pass all the necessary components here | ||
isOpen | boolean | yes | - | Status that makes the dropdown appear | ||
onClose | (value: boolean) ⇒ void | yes | - | Function to close the dropdown | ||
position | left | center | right | - | left | Sets position of dropdown |
trigger | React.ReactNode | yes | - | Pass all the necessary components here | ||
space | number | - | 40 | Space between trigger and box dropdown | ||
style or className | React.CSSProperties | - | - | style customization |
Do you have feedback?
Please let us know to make it better