68f4cf269d
Created by Github action <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22281?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions <github-actions@twenty.com>
58 lines
2.3 KiB
Plaintext
58 lines
2.3 KiB
Plaintext
---
|
|
title: Seletor de Ícone
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/github/github-header.png" alt="Cabeçalho" />
|
|
</Frame>
|
|
|
|
Um seletor de ícones baseado em lista suspensa que permite aos usuários selecionar um ícone de uma lista.
|
|
|
|
<Tabs>
|
|
|
|
<Tab title="Uso">
|
|
|
|
```jsx
|
|
import React, { useState } from "react";
|
|
import { IconPicker } from "@/ui/input/components/IconPicker";
|
|
|
|
export const MyComponent = () => {
|
|
|
|
const [selectedIcon, setSelectedIcon] = useState("");
|
|
const handleIconChange = ({ iconKey, Icon }) => {
|
|
console.log("Selected Icon:", iconKey);
|
|
setSelectedIcon(iconKey);
|
|
};
|
|
|
|
return (
|
|
<IconPicker
|
|
disabled={false}
|
|
onChange={handleIconChange}
|
|
selectedIconKey={selectedIcon}
|
|
variant="primary"
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
|
|
</Tab>
|
|
<Tab title="Propriedades">
|
|
|
|
|
|
| Propriedades | Tipo | Descrição |
|
|
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| desativado | booleano | Desativa o seletor de ícones se definido como `true` |
|
|
| onChange | função | A função de retorno de chamada acionada quando o usuário seleciona um ícone. Ele recebe um objeto com as propriedades `iconKey` e `Icon` |
|
|
| selectedIconKey | string | A chave do ícone selecionado inicialmente |
|
|
| onClickOutside | função | Função de retorno de chamada acionada quando o usuário clica fora da lista suspensa |
|
|
| onClose | função | Função de retorno de chamada acionada quando a lista suspensa é fechada |
|
|
| onOpen | função | Função de retorno de chamada acionada quando a lista suspensa é aberta |
|
|
| variante | string | A variante de estilo visual do ícone clicável. As opções incluem: `primária`, `secundária` e `terciária` |
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
</Tabs>
|