
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@catastrophee/ui
Advanced tools
@catastrophee/ui is a set of React components. These componenets are currently in beta. Use at your own risk
Installing uicommon on your project
npm install --save @catastrophee/ui
or
yarn add @catastrophee/ui
import { Checkbox } from '@catastrophee/ui';
<Checkbox ...props />
Each component has its own README, please refer to those for more information.
Ideally, you shouldn't need to overwrite styles. But if you must, each component takes a prop called style. The style prop is typed.
To know the key you need to use to replace the style, right click on your component and look for data-style attribute on the html tag. For instance, if data-style="list" you can replace the background color with:
<Component style={{ list: { backgroundColor: "green"}}}>
To run examples: From project root folder:
yarn install
yarn run storybook
Note Stories are availables in the files with .stories extensions
For styling, use glamor.
Always sort your keys.
Always put styles in the same file. Usually right after imports, on top. Please don't create one file for style and one file for component. Each component should be one file, easy to use. Default styles should be called defaultStyles.
Always allow style overwrites. For instance, each component should start with const styles = merge({}, defaultStyles, style);
and components should always take a style prop.
Every HTML tag should contain a data-style attribute with the key for that style. If the style has no styles, still create the key but leave it empty
For all styles add proper typing. For instance, let say your component looks like this:
<div>
<span>{title}</span>
</div>
Once you add styles it should look like this
const defaultStyles = {
container: {},
title: {},
};
....
<div {...css(defaultStyles.container)}>
<span {...css(defaultStyles.title)}>{title}</span>
</div>
Once you allow overwrite styles it should look like this
const defaultStyles = {
container: {},
title: {},
};
const styles = merge({}, defaultStyles, props.style);
render() {
<div {...css(styles.container)}>
<span {...css(styles.title)}>{title}</span>
</div>
}
Let people know how to overwrite styles
const defaultStyles = {
container: {},
title: {},
};
interface StylesType {
container: CssPropertyType,
title: CssPropertyType,
}
....
const styles = merge({}, defaultStyles, props.style);
render() {
<div {...css(styles.container)} data-style="container">
<span {...css(styles.title)} data-style="title">{title}</span>
</div>
}
Please take a look at existing components for examples
cd packagaes/ui
yarn install
yarn publish
FAQs
Common UI Components
We found that @catastrophee/ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.