8cadd00d34
Created by Github action --------- Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: github-actions <github-actions@twenty.com>
57 lines
2.6 KiB
Plaintext
57 lines
2.6 KiB
Plaintext
---
|
||
title: בחר איקון
|
||
image: /images/user-guide/github/github-header.png
|
||
---
|
||
|
||
<Frame>
|
||
<img src="/images/user-guide/github/github-header.png" alt="Header" />
|
||
</Frame>
|
||
|
||
בחירה מבוססת תפריט נפתח המאפשרת למשתמשים לבחור איקון מרשימה.
|
||
|
||
<Tabs>
|
||
|
||
<Tab title="Usage">
|
||
|
||
```jsx
|
||
import { RecoilRoot } from "recoil";
|
||
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 (
|
||
<RecoilRoot>
|
||
<IconPicker
|
||
disabled={false}
|
||
onChange={handleIconChange}
|
||
selectedIconKey={selectedIcon}
|
||
variant="primary"
|
||
/>
|
||
</RecoilRoot>
|
||
);
|
||
};
|
||
```
|
||
|
||
</Tab>
|
||
<Tab title="Props">
|
||
|
||
| תכונות | סוג | תיאור |
|
||
| --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||
| לא פעיל | בוליאני | משבית את בחירת האיקון אם מוגדר כ-`true` |
|
||
| onChange | פונקציה | פונקציית חזרה מופעלת כאשר המשתמש בוחר איקון. מקבלת אובייקט עם מאפיינים `iconKey` ו- `Icon` |
|
||
| מפתח איקון נבחר | מחרוזת | המפתח של האיקון הנבחר |
|
||
| onClickOutside | function | פונקציית חזרה מופעלת כאשר המשתמש לוחץ מחוץ לתפריט הנפתח |
|
||
| onClose | function | פונקציית חזרה מופעלת כאשר התפריט הנפתח נסגר |
|
||
| onOpen | function | פונקציית חזרה מופעלת כאשר התפריט הנפתח נפתח |
|
||
| גרסה | string | The visual style variant of the clickable icon. האופציות כוללות: `ראשוני`, `שניוני`, ו- `שלישוני` |
|
||
|
||
</Tab>
|
||
</Tabs>
|