8cadd00d34
Created by Github action --------- Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: github-actions <github-actions@twenty.com>
149 lines
5.0 KiB
Plaintext
149 lines
5.0 KiB
Plaintext
---
|
|
title: Siru
|
|
image: /images/user-guide/github/github-header.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/github/github-header.png" alt="Header" />
|
|
</Frame>
|
|
|
|
A visual element that you can use as a clickable or non-clickable container with a label, optional left and right components, and various styling options to display labels and tags.
|
|
|
|
<Tabs>
|
|
|
|
<Tab title="Usage">
|
|
|
|
```jsx
|
|
import { Chip } from 'twenty-ui/components';
|
|
|
|
export const MyComponent = () => {
|
|
return (
|
|
<Chip
|
|
size="large"
|
|
label="Clickable Chip"
|
|
clickable={true}
|
|
variant="highlighted"
|
|
accent="text-primary"
|
|
leftComponent
|
|
rightComponent
|
|
maxWidth="200px"
|
|
className
|
|
/>
|
|
);
|
|
};
|
|
|
|
```
|
|
|
|
</Tab>
|
|
|
|
<Tab title="Props">
|
|
|
|
| Ominaisuudet | Tyyppi | Kuvaus |
|
|
| ------------ | ------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
|
|
| linkToEntity | string | Linkki yksikköön |
|
|
| entityId | string | Yksikön yksilöivä tunniste |
|
|
| nimi | merkkijono | Yksikön nimi |
|
|
| kuvaUrl | merkkijono | s picture", |
|
|
| avatarType | Avatarin tyyppi | Avatar-tyyppi, jonka haluat näyttää. Has two options: `rounded` and `squared` |
|
|
| variantti | `EntityChipVariant` enum | Yksikön sirun variantti, jonka haluat näyttää. Has two options: `regular` and `transparent` |
|
|
| Vasen ikoni | IkoniKomponentti | Reaktiokomponentti, joka edustaa ikonia. Näytetään sirun vasemmalla puolella |
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
## Esimerkit
|
|
|
|
### Transparent Disabled Chip
|
|
|
|
```jsx
|
|
import { Chip } from 'twenty-ui/components';
|
|
|
|
export const MyComponent = () => {
|
|
return (
|
|
<Chip
|
|
size="large"
|
|
label="Transparent Disabled Chip"
|
|
clickable={false}
|
|
variant="rounded"
|
|
accent="text-secondary"
|
|
leftComponent
|
|
rightComponent
|
|
maxWidth="200px"
|
|
className
|
|
/>
|
|
);
|
|
};
|
|
|
|
```
|
|
|
|
<br/>
|
|
|
|
### Disabled Chip with Tooltip
|
|
|
|
```jsx
|
|
import { Chip } from "twenty-ui/components";
|
|
|
|
export const MyComponent = () => {
|
|
return (
|
|
<Chip
|
|
size="large"
|
|
label="Disabled chip that triggers a tooltip when overflowing."
|
|
clickable={false}
|
|
variant="regular"
|
|
accent="text-primary"
|
|
leftComponent
|
|
rightComponent
|
|
maxWidth="200px"
|
|
className
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
## Entity Chip
|
|
|
|
A Chip-like element to display information about an entity.
|
|
|
|
<Tabs>
|
|
|
|
<Tab title="Usage">
|
|
|
|
```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="Entity name"
|
|
pictureUrl=""
|
|
avatarType="rounded"
|
|
variant="regular"
|
|
LeftIcon={IconTwentyStar}
|
|
/>
|
|
</Router>
|
|
);
|
|
};
|
|
```
|
|
|
|
</Tab>
|
|
|
|
<Tab title="Props">
|
|
|
|
| Ominaisuudet | Tyyppi | Kuvaus |
|
|
| ------------ | ------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
|
|
| linkToEntity | merkkijono | Linkki yksikköön |
|
|
| entityId | merkkijono | Yksikön yksilöivä tunniste |
|
|
| nimi | merkkijono | Yksikön nimi |
|
|
| kuvaUrl | merkkijono | s picture", |
|
|
| avatarType | Avatarin tyyppi | Avatar-tyyppi, jonka haluat näyttää. Has two options: `rounded` and `squared` |
|
|
| variantti | `EntityChipVariant` enum | Yksikön sirun variantti, jonka haluat näyttää. Has two options: `regular` and `transparent` |
|
|
| Vasen ikoni | IkoniKomponentti | Reaktiokomponentti, joka edustaa ikonia. Näytetään sirun vasemmalla puolella |
|
|
|
|
</Tab>
|
|
</Tabs>
|