ButtonDropdown component add custom icon config

0
open
songhn233
songhn233
Posted 2 months ago

ButtonDropdown component add custom icon config #626

Feature request 🚀

  • I will create Pull Request

Expected

  • This component can customize the icon on the right
  • The Select component also has an icon, but serves a decorative role, so there is no need to support custom icons. However, the right half of the dropdown button has a separate icon, so it is necessary to add a custom icon configuration. There are some cases where this configuration is needed, such as switching languages and needing the language icon, or needing the plus icon to indicate the presence of more options

Examples

<ButtonDropdown icon={<Plus />}>
  <ButtonDropdown.Item main>Default Action</ButtonDropdown.Item>
  <ButtonDropdown.Item>Secondary Action</ButtonDropdown.Item>
  <ButtonDropdown.Item>Tertiary Action</ButtonDropdown.Item>
</ButtonDropdown>

config

Attribute Description Type Accepted values Default
icon custom right icon ReactNode - <ButtonDropdownIcon />