Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BorderRadius

Provides a set of radius values that can be used as constants for style mixins or used directly for static styles. The default base is the default fontSize value cut in half. This provides a sensible default for most styling purposes. The radius values can be customised by changing the scale and base option values.

example
Change the scaling between divisions ```ts import { BorderRadius } from '@ef-carbon/react-native-style'; const radius = new BorderRadius({ base: 4, scale: 4}); console.log(radius.tiny); // 0.015625 console.log(radius.smallest); // 0.0625 console.log(radius.smaller); // 0.25 console.log(radius.small); // 1 console.log(radius.normal); // 4 console.log(radius.large); // 16 console.log(radius.larger); // 128 console.log(radius.largest); // 512 console.log(radius.huge); // 2048 ````
example
Customise the divisions ```ts import { BorderRadius } from '@ef-carbon/react-native-style'; const radius = new BorderRadius({ scale: 2, { 300: 3 500: 8, 700: 25 }}); console.log(radius.tiny); // 0.5 console.log(radius.smallest); // 1 console.log(radius.smaller); // 3 (usually 2) console.log(radius.small); // 4 console.log(radius.normal); // 8 console.log(radius.large); // 16 console.log(radius.larger); // 25 (usually 32) console.log(radius.largest); // 64 console.log(radius.huge); // 128 ````

Hierarchy

Implements

Index

Constructors

constructor

  • new BorderRadius(__namedParameters?: object): BorderRadius

Accessors

100

  • get 100(): number

200

  • get 200(): number

300

  • get 300(): number

400

  • get 400(): number

500

  • get 500(): number

600

  • get 600(): number

700

  • get 700(): number

800

  • get 800(): number

900

  • get 900(): number

huge

  • get huge(): number

large

  • get large(): number

larger

  • get larger(): number

largest

  • get largest(): number

normal

  • get normal(): number

small

  • get small(): number

smaller

  • get smaller(): number

smallest

  • get smallest(): number

tiny

  • get tiny(): number

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): number | string