Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
boundless-fitted-text
Advanced tools
Fit given text inside a parent container, obeying implict and explicit constraints.
This component can be useful in situations where an internationalized string is being placed into the UI and it's unclear if all variations of it will fit without excessive amounts of edge-case CSS. Ultimately, it's good at making sure what you put in doesn't overflow.
npm i boundless-fitted-text --save
Then use it like:
/** @jsx createElement */
import { createElement } from 'react';
import Button from 'boundless-button';
import FittedText from 'boundless-fitted-text';
export default () => (
<div className='spread'>
<Button className='tall-button'>
<FittedText>Welcome</FittedText>
</Button>
<Button className='tall-button'>
<FittedText>Добро пожаловать</FittedText>
</Button>
<Button className='tall-button'>
<FittedText>Benvenuto</FittedText>
</Button>
<Button className='tall-button'>
<FittedText>환영합니다</FittedText>
</Button>
<Button className='tall-button'>
<FittedText>സ്വാഗതം</FittedText>
</Button>
</div>
);
FittedText can also just be directly used from the main Boundless library. This is recommended when you're getting started to avoid maintaining the package versions of several components:
npm i boundless --save
the ES6 import
statement then becomes like:
import { FittedText } from 'boundless';
Note: only top-level props are in the README, for the full list check out the website.
There are no required props.
*
· any React-supported attribute
Expects | Default Value |
---|---|
any | n/a |
component
· any valid HTML tag name
Expects | Default Value |
---|---|
string | 'span' |
upscale
· controls if FittedText will automatically scale up the content to fit the available space; normally the component
only scales text down as needed to fit
Expects | Default Value |
---|---|
bool | false |
You can see what variables are available to override in variables.styl.
// Redefine any variables as desired, e.g:
color-accent = royalblue
// Bring in the component styles; they will be autoconfigured based on the above
@require "node_modules/boundless-fitted-text/style"
If desired, a precompiled plain CSS stylesheet is available for customization at /build/style.css
, based on Boundless's default variables.
FAQs
Fit given text inside a parent container, obeying implict and explicit constraints.
The npm package boundless-fitted-text receives a total of 0 weekly downloads. As such, boundless-fitted-text popularity was classified as not popular.
We found that boundless-fitted-text 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.