![Introducing Dashboard Analytics](https://cdn.sanity.io/images/cgdhsj6q/production/af327c5bd94708db501516a75da6870aef894c64-2286x1522.png?w=400&fit=max&auto=format)
Product
Introducing Dashboard Analytics
We're introducing a new Analytics feature in the Socket dashboard so you can view changes in your organization's and repositories' alerts over time.
@sanity/ui-workshop
Advanced tools
An environment for designing, reviewing, and quality-testing React components.
An environment for designing, reviewing, and quality-testing React components.
# Install `@sanity/ui-workshop` as dev dependency
npm install @sanity/ui-workshop -D
# Install peer dependencies
npm install @sanity/icons @sanity/ui react react-dom styled-components
Add a workshop.config.ts
(or .js) in the root of your project:
import {defineConfig} from '@sanity/ui-workshop'
export default defineConfig({
title: 'My UI Workshop',
})
Start the workshop
workshop dev
workshop
will automatically find workshop "scopes" by searching for files mathing these patterns:
src/**/__workshop__/index.js
src/**/__workshop__/index.jsx
src/**/__workshop__/index.ts
src/**/__workshop__/index.tsx
Define your first workshop scope by creating src/__workshop__/index.tsx
:
import {
defineScope,
useBoolean,
useNumber,
useSelect,
useString,
useText,
} from '@sanity/ui-workshop'
export default defineScope({
name: 'test',
title: 'Test',
stories: [
{
name: 'test',
title: 'Test',
component: TestStory,
},
],
})
const options = {
None: '',
Small: 'sm',
Medium: 'md',
Large: 'lg',
}
function TestStory() {
const text = useText('Text', 'Hello, world')
const boolean = useBoolean('Boolean', true)
const number = useNumber('Number', 1234)
const string = useString('String', '...')
const option = useSelect('Select option', options)
return (
<div>
<h1>This is my first story.</h1>
<p>Some text: {text}</p>
<p>A boolean: {boolean ? 'true' : 'false'}</p>
<p>A number: {number}</p>
<p>A string: {string}</p>
<p>An option: {option}</p>
</div>
)
}
FAQs
An environment for designing, reviewing, and quality-testing React components.
We found that @sanity/ui-workshop demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're introducing a new Analytics feature in the Socket dashboard so you can view changes in your organization's and repositories' alerts over time.
Security News
A new OpenSSF report uncovers critical gaps in secure software training, with 75% of new developers unfamiliar with secure practices, highlighting urgent educational needs.
Security News
The 2023 Python Developers Survey reveals key trends in packaging, web frameworks, and developer demographics, highlighting a shift toward innovative tools as the Python community diversifies and grows among less experienced developers.