The Sidebar component is a large floating container that goes into the page from the corners. It allows us to present actions, forms or sections with a lot of information about the context of the page.
$ yarn add @nimbus-ds/sidebar
$ npm install @nimbus-ds/sidebar
The component consists of a full-screen translucent background and a floating container that occupies the full height of the screen and a fixed width, with shadow and optional padding.
On desktop it has a fixed width and occupies the entire top, on mobile it occupies the entire screen.
We use the Sidebar to present actions, dialogs or forms that open over the context of the page, when they are too long to use in a Modal, but the information is relevant enough not to navigate to another page.
Despite being a floating component, it partially blocks the background view, but should be used sparingly.
Recommendations for use
- Create a menu for an app
- Display a list of filters with many options
- Present an interactive list with many entries and a search engine
- Modal - It is a floating element that allows us to present actions or brief confirmation messages to the user.
- Popover - It is a floating element that can be used to present information or actions in a non-intrusive way.
View docs here.