-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(plasma-web-docs): add Counter docs
- Loading branch information
1 parent
e8bba2e
commit 9b4b76c
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
id: counter | ||
title: Counter | ||
--- | ||
|
||
import { PropsTable, Description, StorybookLink } from '@site/src/components'; | ||
|
||
# Counter | ||
<Description name="Counter" /> | ||
<PropsTable name="Counter" exclude={['css']} /> | ||
<StorybookLink name="Counter" /> | ||
|
||
## Примеры | ||
|
||
### Максимальное значение числового бейджа | ||
Задается с помощью свойства `maxCount`. | ||
|
||
```tsx live | ||
import React from 'react'; | ||
import { Counter } from '@salutejs/plasma-web'; | ||
|
||
export function App() { | ||
return ( | ||
<div> | ||
<Counter count={10} maxCount={9} /> | ||
<Counter count={100} maxCount={99} /> | ||
</div> | ||
); | ||
} | ||
``` | ||
|
||
### Размер числового бейджа | ||
Размер задается с помощью свойства `size`. Возможные значения свойтсва: `"xs"` или `"xxs"`. | ||
|
||
```tsx live | ||
import React from 'react'; | ||
import { Counter } from '@salutejs/plasma-web'; | ||
|
||
export function App() { | ||
return ( | ||
<div> | ||
<Counter count={10} size="xs" /> | ||
<Counter count={10} size="xxs" /> | ||
</div> | ||
); | ||
} | ||
``` | ||
|
||
### Вид числового бейджа | ||
Вид задается с помощью свойства `view`. Возможные значения свойства `view`: | ||
|
||
+ `"primary"` – основной бейдж; | ||
+ `"accent"` – бейдж акцентного цвета; | ||
+ `"positive"` – успешное завершение; | ||
+ `"warning"` – предупреждение; | ||
+ `"negative"` – ошибка; | ||
+ `"dark"` – темный бэйдж; | ||
+ `"light"` – светлый бэйдж. | ||
|
||
```tsx live | ||
import React from 'react'; | ||
import { Counter } from '@salutejs/plasma-web'; | ||
|
||
export function App() { | ||
return ( | ||
<div> | ||
<Counter count={10} view="primary" /> | ||
<Counter count={10} view="accent" /> | ||
<Counter count={10} view="positive" /> | ||
<Counter count={10} view="warning" /> | ||
<Counter count={10} view="negative" /> | ||
<Counter count={10} view="dark" /> | ||
<Counter count={10} view="light" /> | ||
</div> | ||
); | ||
} | ||
``` |