Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanity-io/example-dashboard-widget-cats
A dashboard widget for Sanity Content Studio
https://github.com/sanity-io/example-dashboard-widget-cats
Last synced: 13 days ago
JSON representation
A dashboard widget for Sanity Content Studio
- Host: GitHub
- URL: https://github.com/sanity-io/example-dashboard-widget-cats
- Owner: sanity-io
- License: mit
- Created: 2019-02-21T09:22:43.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-25T01:57:21.000Z (about 1 month ago)
- Last Synced: 2024-10-14T13:56:14.807Z (24 days ago)
- Language: TypeScript
- Size: 3.13 MB
- Stars: 1
- Watchers: 9
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sanity - Cats dashboard widget - A dashboard widget for Sanity Content Studio (Sample projects / Other examples)
README
# sanity-plugin-dashboard-widget-cats
>This is a **Sanity Studio v3** plugin.
> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/example-dashboard-widget-cats/tree/studio-v2).## What is it?
An example dashboard widget for [@sanity/dashboard][dashboard-plugin] that shows a random cat.
This plugin mostly exist to show how a simple widget can be made.
![Cat widget](assets/cat.png)
## Install
```
npm install --save sanity-plugin-dashboard-widget-cats
```or
```
yarn add sanity-plugin-dashboard-widget-cats
```Ensure that you have followed install and usage instructions for @sanity/dashboard.
## Usage
Add it as a widget to @sanity/dashboard plugin in sanity.config.ts (or .js):
```js
import { dashboardTool } from "@sanity/dashboard";
import { catsWidget } from "sanity-plugin-dashboard-widget-cats";export default defineConfig({
// ...
plugins: [
dashboardTool({
widgets: [
catsWidget(),
],
}
),
]
})
```## Configure
The widget size can be controlled using layout.width:
```js
dashboardTool({
widgets: [
catsWidget({ layout: { width: "small" } }),
],
}
)
```## License
MIT-licensed. See LICENSE.
## Develop & test
This plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)
with default configuration for build & watch scripts.See [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)
on how to run this plugin with hotreload in the studio.### Release new version
Run ["CI & Release" workflow](https://github.com/sanity-io/example-dashboard-widget-cats/actions/workflows/main.yml).
Make sure to select the v3 branch and check "Release new version".Semantic release will only release on configured branches, so it is safe to run release on any branch.