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.1 KiB
Plaintext
149 lines
5.1 KiB
Plaintext
---
|
|
title: Xip
|
|
image: /images/user-guide/github/github-header.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/github/github-header.png" alt="Header" />
|
|
</Frame>
|
|
|
|
Un element visual que pots utilitzar com a contenidor clicable o no clicable amb una etiqueta, components opcionals a l'esquerra i a la dreta, i diverses opcions d'estil per mostrar etiquetes i 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">
|
|
|
|
| Propietats | Tipus | Descripció |
|
|
| ----------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
|
|
| enllaçaAmbEntitat | cadena | L'enllaç a l'entitat |
|
|
| idEntitat | cadena | L'identificador únic per a l'entitat |
|
|
| nom | cadena | El nom de l'entitat |
|
|
| pictureUrl | cadena | s picture", |
|
|
| tipusAvatar | Tipus d'Avatar | El tipus d'avatar que vols mostrar. Has two options: `rounded` and `squared` |
|
|
| variant | enumeració `EntityChipVariant` | Variant del xip d'entitat que vols mostrar. Té dues opcions: `regular` i `transparent` |
|
|
| LeftIcon | ComponentIcona | Un component React que representa una icona. Mostrat al costat esquerre del xip |
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
## Exemples
|
|
|
|
### 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
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
## Xip d'Entitat
|
|
|
|
Un element semblant a un xip per mostrar informació sobre una entitat.
|
|
|
|
<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">
|
|
|
|
| Props | Tipus | Descripció |
|
|
| ----------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
|
|
| enllaçaAmbEntitat | cadena | L'enllaç a l'entitat |
|
|
| idEntitat | cadena | L'identificador únic per a l'entitat |
|
|
| nom | cadena | El nom de l'entitat |
|
|
| pictureUrl | cadena | s picture", |
|
|
| tipusAvatar | Tipus d'Avatar | El tipus d'avatar que vols mostrar. Has two options: `rounded` and `squared` |
|
|
| variant | enumeració `EntityChipVariant` | Variant del xip d'entitat que vols mostrar. Té dues opcions: `regular` i `transparent` |
|
|
| LeftIcon | ComponentIcona | Un component React que representa una icona. Mostrat al costat esquerre del xip |
|
|
|
|
</Tab>
|
|
</Tabs>
|