Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-controlled-text
Advanced tools
Multiline text clamp and scale to fit component for React ⚛️
Multiline text clamp and scale to fit component for React ⚛️
Both features are enabled by default (see props below).
Storybook (https://gr34se.github.io/react-controlled-text)
import ControlledText from "react-controlled-text";
<div style={{backgroundColor: "lightgreen", width: 200, height: 80, padding: 2}}>
<ControlledText fontSizeMin={12} fontSizeMax={15} clampSuffix={"..."}>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text ever since the 1500s, when an unknown
printer took a galley of, type and scrambled it to make a type specimen book.
</ControlledText>
</div>
Prop name | Type | Default | Required | Note |
---|---|---|---|---|
fontSizeMin | number | 10 | no | Minimum font size |
fontSizeMax | number | 16 | no | Maximum font size |
className | string | "react-controlled-text" | no | className that output tag will receive |
tagName | TagName (string) | "span" | no | One of: span, div, p, a, h1, h2, h3, h4, h5, h6 |
resizeThrottle | number | 250 | no | Number of milliseconds to throttle window resize callback |
clampSuffix | string | "..." | no | String to add at the end of clamped text |
disableScaling | boolean | false | no | Prop to disable auto-scaling |
disableTextClamp | boolean | false | no | Prop to disable auto-text-clamping if needed |
You can also pass other common HTML props (HTMLAttributes) such as onClick directly to the ControlledText component.
FAQs
Multiline text clamp and scale to fit component for React ⚛️
We found that react-controlled-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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.