Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions packages/uui-responsive-container/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# uui-responsive-container

A responsive container that automatically collapses overflowing children into a dropdown menu.

## Installation

```zsh
npm i @umbraco-ui/uui-responsive-container
```

## Usage

```javascript
import '@umbraco-ui/uui-responsive-container';
```

```html
<uui-responsive-container>
<uui-button>Save</uui-button>
<uui-button>Edit</uui-button>
<uui-button>Delete</uui-button>
<uui-button>Share</uui-button>
</uui-responsive-container>
```

When there's not enough space, items collapse into a "more" dropdown automatically.

## Properties

| Property | Type | Default | Description |
| ---------- | -------------------- | ------- | ------------------------------ |
| `collapse` | `'start'` \| `'end'` | `'end'` | Which side items collapse from |

### collapse="end" (default)

Items collapse from the right side. The "more" button appears on the right.

```html
<uui-responsive-container collapse="end">
<uui-button>First</uui-button>
<uui-button>Second</uui-button>
<uui-button>Third</uui-button>
</uui-responsive-container>
```

### collapse="start"

Items collapse from the left side. The "more" button appears on the left.

```html
<uui-responsive-container collapse="start">
<uui-button>First</uui-button>
<uui-button>Second</uui-button>
<uui-button>Third</uui-button>
</uui-responsive-container>
```

## CSS Custom Properties

| Property | Default | Description |
| -------------------------------- | ------- | ----------------- |
| `--uui-responsive-container-gap` | `8px` | Gap between items |

### Example: Custom Gap

```html
<uui-responsive-container style="--uui-responsive-container-gap: 16px;">
<uui-button>Save</uui-button>
<uui-button>Edit</uui-button>
</uui-responsive-container>
```
1 change: 1 addition & 0 deletions packages/uui-responsive-container/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './uui-responsive-container.element';
Loading
Loading