Socket
Socket
Sign inDemoInstall

@yuhu-inc/yuhui

Package Overview
Dependencies
96
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @yuhu-inc/yuhui

## Goals


Version published
Weekly downloads
340
increased by28.79%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

YuhUI

Goals

Accessible React components

  • Support for translations is upfront
  • Follow web accessibility standards

Getting started

Using the package

$ npm install @yuhu-inc/yuhui # or
$ yarn add @yuhu-inc/yuhui

Developing

$ yarn storybook

Running tests

$ yarn watch

Publishing

$ yarn publish --access public

Basics

The component library relies on a component called <ContentProvider /> to provide content (copy and styles) to its children components.

Example

Create an object with contentNodes and theme as keys. contentNodes is an object with its key being the name of the "content piece" that can be referenced in other components. Its value is includes translated copies. The theme API is still quite unstable and can be updated with breaking changes often.

const content = {
  contentNodes: {
    nodeName: {
      copy: {
        en: "an example",
        fr: "un exemple"
      }
    }
  },
  theme: {
    /* stuff */
  }
};

Pass the content object into the ContentProvider as a prop.

import { ContentProvider } from "@yuhuinc/yuhui";

const Example = ({ children }) => (
  <ContentProvider content={content} lang="en">
    {children}
  </ContentProvider>
);

Then you can reference the key name of the content node in components.

import { P } from "@yuhuinc/yuhui";

const App = () => (
  <Example>
    <P>You can still do this, but what's below instead:</P>
    <P key="nodeName" />
  </Example>
);

Resources

  • A11Y Style Guide
  • Reakit

FAQs

Last updated on 24 Mar 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc