Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
formfcw committed Oct 23, 2023
0 parents commit f087813
Show file tree
Hide file tree
Showing 12 changed files with 7,085 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
node_modules
dist
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Tab Group Interface for Directus

[![NPM version](https://img.shields.io/npm/v/directus-extension-tab-group)](https://www.npmjs.com/package/directus-extension-tab-group)

A group interface with a tab menu for toggling the visibility of fields within the group.

```sh
# Install via npm
npm install directus-extension-tab-group
# Install via yarn
yarn add directus-extension-tab-group
# Install via pnpm
pnpm add directus-extension-tab-group
```

## Use case

The main use case for this extension is to provide an alternative solution to the translation interface. You can use this tab group interface to toggle fields individually or some of them or all of them together as you like. For example, you can toggle the visibility of a `title_de` and a `title_en` field.

![](docs/input-a.png)
![](docs/input-b.png)
![](docs/input-ab.png)

## Options

In your interface settings, you can use a JSON field to specify which button displays which fields, like:

```json
[
{
"label": "Deutsch",
"active": true,
"fields": [
{
"name": "title_de",
"activeWidth": "full"
}
]
},
{
"label": "English",
"fields": [
{
"name": "title_en",
"activeWidth": "full"
}
]
},
{
"label": "Deutsch + English",
"fields": [
{
"name": "title_de",
"activeWidth": "half"
},
{
"name": "title_en",
"activeWidth": "half"
}
]
}
]
```

## Overwriting styles

Use the following classes to customize CSS styles via the Directus Project Settings: `.tab-group`, `.tab-group .menu` or `.tab-group .menu .menu-item`.

Example:

```CSS
/* disable the vertical bar */
.tab-group::before {
content: none !important;
}
```
Binary file added docs/input-a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/input-ab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/input-b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f087813

Please sign in to comment.