套件

@master/css.react@master/css.react

NPM package ( download / month )NPM package ( download / month )NPM package size (gzipped size)NPM package size (gzipped size)Source codeSource code

Integrate Master CSS in React way

Installation

npm i @master/css.react

The package provides a convenient React provider and context for using @master/css-runtime in React applications.


API Reference

<CSSRuntimeProvider>

The CSSRuntimeProvider will automatically initialize a CSSRuntime instance and manage it according to changes in config or root element.

import CSSRuntimeProvider from '@master/css.react'import config from './master.css'export default function App({ children }) {    return (        <CSSRuntimeProvider config={config}>            {children}        </CSSRuntimeProvider>    )}

CSSRuntimeProviderProps

import type { Config } from '@master/css'import type { ReactNode } from 'react'export default interface CSSRuntimeProviderProps {    children?: ReactNode,    config?: Config,    root?: Document | ShadowRoot | null // null for Element.shadowRoot}

useCSSRuntime()

Access to the CSSRuntime instance.

import { useCSSRuntime } from '@master/css.react'export function YourComponent() {    const cssRuntime = useCSSRuntime()    // ...}

  • Master UI


© 2025 Aoyue Design LLC.MIT License
Trademark Policy