Spaces
Kitten is a Desktop Manager, which means it can manage multiple desktops, or “spaces”. This is a feature that is common in many operating systems, and it allows you to organize your windows into different groups. This can be useful for organizing your work, or for separating different tasks.
Creating Spaces
You can create spaces by putting Space
compoments inside the Spaces
component. Here is an example:
This is how we can create a simple app with three spaces. Each space contains a title and a paragraph of text. You can switch between spaces by clicking on the space in the space bar at the top of the screen.
By default, Kitten has mouse wheel switching enabled, so you can also switch between spaces by scrolling up and down with your mouse wheel.
API Reference
Spaces has a few options that you can use to customize its behavior.
Spaces
Props
Name | Type | Default |
---|---|---|
children | React.ReactNode | null |
bounceDelay | number | 200 |
scrollThreshold | number | 200 |
swipeThreshold | number | 200 |
space | number | 0 |
onSpaceChange | Function | () => {} |
{ … HTML attributes } | any | {} |
Space
Props
- (children) The content of the space (Example:
<Space>My Content</Space>
) - { … HTML attributes } Any other HTML attributes you want to pass to the space like
className
,style
, etc.
Name | Type | Default |
---|---|---|
children | React.ReactNode | null |
snap | boolean | true |
snapMargin | number | 20 |
snapThreshold | number | 50 |
snapWith | 'all' | 'move' | 'resize' | 'all' |
{ … HTML attributes } | any | {} |
- Installing dependencies
- Starting http server