Skip to content
0xBuidlerHQPublic

About

πŸ’… Beaut is a focused toolkit that helps you ship polished crypto-facing UI experiences with consistent formatting, validation, and React-friendly helpers.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

12 Commits

Folders and files

Repository files navigation

Relay logo

πŸ’… Beaut

πŸ’… Beaut is a focused toolkit that helps you ship polished crypto-facing UI experiences with consistent formatting, validation, and React-friendly helpers.

Features

  • Format address
  • Format hash
  • Format currency
  • Format explorerAddress
  • Format explorerBlock
  • Format explorerTxHash
  • Format bigint
  • Format kmb
  • Format percent

... and a lot more.

Overview

Core

import { Beaut } from "@0xhq/beaut";

// Base.
Beaut.address("0x1234567890abcdef1234567890abcdef12345678"); // β†’ "0x1234...5678"
Beaut.hash("0xabcde4e7f9ee58b4574bad27d9c1c72a9c656f7cf3b7469c3ea027b456a3d0e"); // β†’ "0xabcd...3d0e"

// Currency.
Beaut.money(12345.67, { currency: "EUR" }); // β†’ "€12,345.67"

// Explorer.
Beaut.explorerAddress("https://etherscan.io", "0x1234...5678"); // β†’ "https://etherscan.io/address/0x1234...5678"
Beaut.explorerBlock("https://etherscan.io", 17500000); // β†’ "https://etherscan.io/block/17500000"
Beaut.explorerTxHash("https://etherscan.io", "0xabcde4e7f9ee58b4574bad27d9c1c72a9c656f7cf3b7469c3ea027b456a3d0e"); // β†’ "https://etherscan.io/tx/0xabcde4e7f9ee58b4574bad27d9c1c72a9c656f7cf3b7469c3ea027b456a3d0e"

// Number.
Beaut.bigint(1_000_000n, 18); // β†’ "0.000001"
Beaut.kmb(1_250_000); // β†’ "1.25M"
Beaut.percent(0.1234); // β†’ "12.34%"

React

Components

Hooks

import { useBigIntInput } from "@0xhq/beaut/react";

// useBigIntInput.
const { value, valueAsBigInt, handleInputChange, isError } = useBigIntInput();
<input value={value} onChange={handleInputChange} />

Documentation

Head to the documentation to read and learn more about @0xhq/beaut.

About

πŸ’… Beaut is a focused toolkit that helps you ship polished crypto-facing UI experiences with consistent formatting, validation, and React-friendly helpers.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages