
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@_nu/react-button
Advanced tools
No UI dependency button of react.
English | 简体中文
yarn add @_nu/react-button @_nu/css-button
/* @components/Button/index.js */
import Button from "@_nu/react-button";
import "@_nu/css-button"; // core style
import "@_nu/css-button/css/skins/bootstrap.css"; // skin of bootstrap
import './style.css'; // custome style
Button.defaultProps.classNameBase = "_fill"; // base className of button
export default Button;
import Button from "./components/Button";
const Page=()=>{
return (
<div>
<Button>Button</Button>
<Button href="/nu-button">Button</Button>
</div>
);
};
export default Page;
<Component>
<SubComponent>{children}</SubComponent>
</Component>
| Prop | type | Default | Function |
|---|---|---|---|
| children | string | Array | ' ' | children |
| className | string | Array | ' ' | className |
| classNameDefault | string | Array | '_fill' | default className |
| href | string | ' ' | href for a |
| disabled | boolean | false | disabled status of button |
| Component | string | func | object | 'button' | wrapper |
| SubComponent | string | func | object | 'span' | container |
<Button>hello</Button>
<Button disabled>hello</Button>
<Button className="_primary">hello</Button>
<Button SubComponent="strong">hello</Button>
<Button href="." title="hello">hello</Button>
<button class="nu_btn _fill" type="button"><span>hello</span></button>
<button class="nu_btn _fill" type="button" disabled><span>hello</span></button>
<button class="nu_btn _primary _fill" type="button"><span>hello</span></button>
<button class="nu_btn _fill" type="button"><strong>hello</strong></button>
<a class="nu_btn _fill" href="." title="hello"><span>hello</span></a>
<Button className="_primary _fill _ghost _primary">hello</Button>
<Button className={['_primary','_fill','_ghost','_primary','','',null]}>hello</Button>
<button class="nu_btn _primary _ghost" type="button"><span>hello</span></button>
_fill,_ghost,_link show on className. only the last one will be render;import { Link } from "@reach/router";
import Button from "@_nu/react-button";
import "@_nu/css-button";
import "./style.css";
// Custom
Button.defaultProps.component = Link;
export default Button;
Button.defaultProps.classNameDefault = "_fill _capsule";
// or
Button.defaultProps.classNameDefault = ["_fill", "_capsule"];
Go to @_nu/css-button
FAQs
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.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.