-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Overlay): documentation and codestyle updates
- Loading branch information
Showing
8 changed files
with
209 additions
and
194 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
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
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 |
---|---|---|
@@ -1,32 +1,46 @@ | ||
<!--GITHUB_BLOCK--> | ||
|
||
# Loader | ||
# Overlay | ||
|
||
<!--/GITHUB_BLOCK--> | ||
|
||
```tsx | ||
import {Overlay} from '@gravity-ui/uikit'; | ||
``` | ||
|
||
The `Overlay` component renders an overlay over the parent element with relative position. | ||
The `Overlay` component renders an overlay over the parent element with relative position, | ||
i.e. parent element must have `position` set to `relative`. | ||
For example, it can be used to preserve the desired layout while loading data. | ||
|
||
### PropTypes | ||
|
||
| Name | Type | Required | Default | Description | | ||
| :-------- | :----------------- | :------: | :------ | :---------------------------------- | | ||
| className | `String` | | | CSS class name of the root element | | ||
| visible | `Boolean` | | `false` | Overlay visibility state | | ||
| view | `"base"` `"float"` | | `base` | Overlay background style | | ||
| children | `React.ReactNode` | | | Content, usually a Loader component | | ||
|
||
### Basic usage | ||
|
||
```jsx | ||
<div style={{position: 'relative'}}> | ||
<Box position="relative"> | ||
<div>Some content to hide under overlay</div> | ||
<Overlay visible={loading}> | ||
<Loader /> | ||
</Overlay> | ||
</div> | ||
</Box> | ||
``` | ||
|
||
## Appearance | ||
|
||
### Background | ||
|
||
You can use `base` or `float` background colors. | ||
|
||
<!--GITHUB_BLOCK--> | ||
|
||
```tsx | ||
<Overlay background="base"> | ||
<Overlay background="float"> | ||
``` | ||
|
||
<!--/GITHUB_BLOCK--> | ||
|
||
## Properties | ||
|
||
| Name | Type | Required | Default | Description | | ||
| :--------- | :----------------- | :------: | :------ | :---------------------------------- | | ||
| className | `String` | | | CSS class name of the root element | | ||
| visible | `Boolean` | | `false` | Overlay visibility state | | ||
| background | `"base"` `"float"` | | `base` | Overlay background style | | ||
| children | `React.ReactNode` | | | Content, usually a Loader component | |
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,7 @@ | ||
import {Meta, Markdown} from '@storybook/addon-docs'; | ||
import * as Stories from './OverlayShowcase.stories'; | ||
import Readme from '../README.md?raw'; | ||
|
||
<Meta of={Stories} /> | ||
|
||
<Markdown>{Readme}</Markdown> |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.