001c2097a3
Created by Github action <!-- mintlify-editor-comments:start --> Mintlify --- 0 threads from 0 users in Mintlify - No unresolved comments <!-- mintlify-editor-comments:end --> <!-- mintlify-comment--> <a href="https://dashboard.mintlify.com/twenty/twenty/editor/i18n-docs?source=pr_comment" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://d3gk2c5xim1je2.cloudfront.net/assets/open-mintlify-editor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://d3gk2c5xim1je2.cloudfront.net/assets/open-mintlify-editor-light.svg"><img src="https://d3gk2c5xim1je2.cloudfront.net/assets/open-mintlify-editor-light.svg" alt="Open in Mintlify Editor"></picture></a> <!-- /mintlify-comment --> Co-authored-by: github-actions <github-actions@twenty.com>
155 lines
4.7 KiB
Plaintext
155 lines
4.7 KiB
Plaintext
---
|
|
title: Čip
|
|
image: /images/user-guide/github/github-header.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/github/github-header.png" alt="Hlavička" />
|
|
</Frame>
|
|
|
|
Vizuální prvek, který můžete používat jako kliknutelný nebo nekliknutelný kontejner se štítkem, volitelnými levými a pravými komponenty a různými styly pro zobrazení štítků a značek.
|
|
|
|
<Tabs>
|
|
|
|
<Tab title="Použití">
|
|
|
|
```jsx
|
|
import { Chip } from 'twenty-ui/components';
|
|
|
|
export const MyComponent = () => {
|
|
return (
|
|
<Chip
|
|
size="large"
|
|
label="Klikatelný štítek"
|
|
clickable={true}
|
|
variant="highlighted"
|
|
accent="text-primary"
|
|
leftComponent
|
|
rightComponent
|
|
maxWidth="200px"
|
|
className
|
|
/>
|
|
);
|
|
};
|
|
|
|
```
|
|
|
|
</Tab>
|
|
|
|
<Tab title="Vlastnosti">
|
|
|
|
|
|
| Vlastnosti | Typ | Popis |
|
|
| ------------- | ------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| odkazNaEntitu | řetězec | Odkaz na entitu |
|
|
| entitaId | řetězec | Jedinečný identifikátor pro entitu |
|
|
| název | textový řetězec | Název entity |
|
|
| obrázekUrl | řetězec | s obrázkem", |
|
|
| typAvatara | Typ avatara | Typ avatara, který chcete zobrazit. Má dvě možnosti: `zaoblený` a `hranatý` |
|
|
| varianta | `EntityChipVariant` výčet | Varianta čipu entity, kterou chcete zobrazit. Má dvě možnosti: `běžný` a `transparentní` |
|
|
| Levá ikona | Ikonová komponenta | React komponenta představující ikonu. Zobrazeno na levé straně čipu |
|
|
|
|
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
## Příklady
|
|
|
|
### Transparentní deaktivovaný čip
|
|
|
|
```jsx
|
|
import { Chip } from 'twenty-ui/components';
|
|
|
|
export const MyComponent = () => {
|
|
return (
|
|
<Chip
|
|
size="large"
|
|
label="Průhledný neaktivní štítek"
|
|
clickable={false}
|
|
variant="rounded"
|
|
accent="text-secondary"
|
|
leftComponent
|
|
rightComponent
|
|
maxWidth="200px"
|
|
className
|
|
/>
|
|
);
|
|
};
|
|
|
|
```
|
|
|
|
<br />
|
|
|
|
### Deaktivovaný čip s tooltipem
|
|
|
|
```jsx
|
|
import { Chip } from "twenty-ui/components";
|
|
|
|
export const MyComponent = () => {
|
|
return (
|
|
<Chip
|
|
size="large"
|
|
label="Neaktivní štítek, který při přetečení zobrazí popisek."
|
|
clickable={false}
|
|
variant="regular"
|
|
accent="text-primary"
|
|
leftComponent
|
|
rightComponent
|
|
maxWidth="200px"
|
|
className
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
## Čip entity
|
|
|
|
Prvek podobný čipu pro zobrazení informací o entitě.
|
|
|
|
<Tabs>
|
|
|
|
<Tab title="Použití">
|
|
|
|
```jsx
|
|
import { BrowserRouter as Router } from 'react-router-dom';
|
|
import { IconTwentyStar } from 'twenty-ui/display';
|
|
import { Chip } from 'twenty-ui/components';
|
|
|
|
export const MyComponent = () => {
|
|
return (
|
|
<Router>
|
|
<Chip
|
|
linkToEntity="/entity-link"
|
|
entityId="entityTest"
|
|
name="Název entity"
|
|
pictureUrl=""
|
|
avatarType="rounded"
|
|
variant="regular"
|
|
LeftIcon={IconTwentyStar}
|
|
/>
|
|
</Router>
|
|
);
|
|
};
|
|
```
|
|
|
|
</Tab>
|
|
|
|
<Tab title="Vlastnosti">
|
|
|
|
|
|
| Vlastnosti | Typ | Popis |
|
|
| ------------- | ------------------------- | ---------------------------------------------------------------------------------------- |
|
|
| odkazNaEntitu | řetězec | Odkaz na entitu |
|
|
| entitaId | řetězec | Jedinečný identifikátor pro entitu |
|
|
| název | řetězec | Název entity |
|
|
| obrázekUrl | řetězec | s obrázkem", |
|
|
| typAvatara | Typ avatara | Typ avatara, který chcete zobrazit. Má dvě možnosti: `zaoblený` a `hranatý` |
|
|
| varianta | `EntityChipVariant` výčet | Varianta čipu entity, kterou chcete zobrazit. Má dvě možnosti: `běžný` a `transparentní` |
|
|
| Levá ikona | Ikonová komponenta | React komponenta představující ikonu. Zobrazeno na levé straně čipu |
|
|
|
|
|
|
|
|
</Tab>
|
|
</Tabs>
|