sanity-plugin-dashboard-widget-notes

0.4.1 • Public • Published

dashboard-widget-notes

Dashboard widget for the Sanity Content Studio which lets you write simple "post-it" notes.

Uses polished.js to find the best contrast depending on the luminosity of the given backgroundColor. Override with color in options.

sanity-plugin-dashboard-widget-notes-2

Quick start

Install the plugin in your Sanity Studio project folder:

sanity install dashboard-widget-notes

Add to dashboardConfig.js:

export default {
  widgets: [
    { name: 'notes' }
    // ...the rest of your widgets
  ]
}

Options

There are some options available.

title (string)

Widget title. Defaults to Notes

{
  name: 'notes',
  options: {
    title: 'My notes'
  }
}

placeholder (string)

Placeholder text in the <textarea>. Defaults to ...

{
  name: 'notes',
  options: {
    title: 'My notes',
    placeholder: 'What is up?'
  }
}

backgroundColor (string)

Background color for the widget. A black or white text color is set automatically depending on the luminosity. Defaults to #ffff88

{
  name: 'notes',
  options: {
    title: 'My notes',
    placeholder: 'What is up?',
    backgroundColor: '#eee',
  }
}

color (string)

Override text color for the widget.

{
  name: 'notes',
  options: {
    title: 'My notes',
    placeholder: 'What is up?',
    backgroundColor: '#eee',
    color: 'red',
  }
}

Local development

  1. Fork/clone this repo
  2. Install dependencies (yarn or npm install)
  3. Link for local development (yarn link or npm link)
  4. Run build to compile your changes (yarn build or npm run build)
  5. Link in a local studio folder (yarn link "sanity-plugin-dashboard-widget-notes" or npm link sanity-plugin-dashboard-widget-notes)
  6. Add sanity-dashboard-widget-notes to the plugin array in sanity.json
  7. Add {name: 'notes'} to your dashboardConfig.js

Package Sidebar

Install

npm i sanity-plugin-dashboard-widget-notes

Weekly Downloads

8

Version

0.4.1

License

MIT

Unpacked Size

33.5 kB

Total Files

12

Last publish

Collaborators

  • kmelve
  • kolby