New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fluid-content

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluid-content

Auto scale element content proportionally based on the parent width

latest
npmnpm
Version
0.3.10
Version published
Maintainers
0
Created
Source

fluid-content

📏 React/Vue component to auto scale content proportionally based on the parent width.

Install

npm install fluid-content

React

React demo

import { Fluid } from 'fluid-content/react'

<Fluid base={1000}>
  ...
</Fluid>

Vue

Vue demo

import { Fluid } from 'fluid-content/vue'

<Fluid :base="1000">
  ...
</Fluid>

Breakpoints

You can provide an array of base values to create responsive breakpoints:

import { Fluid } from 'fluid-content/react'

<Fluid base={[400, 800, 1200]}>
  ...
</Fluid>

The first value takes precedence. So in this case if the parent element is 600px wide, the content will scale using base = 400. You can flip this behavior by putting the values from high to low ([1200, 800, 400]).

You can also pass Infinity to indicate that the content shouldn't scale after a given breakpoint:

import { Fluid } from 'fluid-content/react'

// Only scale below a parent width of 1200px
<Fluid base={[1200, Infinity]}>
  ...
</Fluid>

FAQs

Package last updated on 14 Nov 2024

Did you know?

Socket

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.

Install

Related posts