All Projects → developit → preact-views

developit / preact-views

Licence: MIT License
📺 Named views for Preact, with easy-as-pie linking between them.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to preact-views

preact-route-async
Easy asynchronous loading for your router components. For 440B.
Stars: ✭ 36 (-7.69%)
Mutual labels:  preact, preact-components, preact-router
preact-component-console
A console emulator for preact.
Stars: ✭ 29 (-25.64%)
Mutual labels:  preact, preact-components
preact-motion
A fork of React-Motion to be used with Preact
Stars: ✭ 28 (-28.21%)
Mutual labels:  preact, preact-components
preact-custom-scrollbars
⇅ Preact scrollbars component
Stars: ✭ 20 (-48.72%)
Mutual labels:  preact, preact-components
preact-bind-group
Preact Component to Group Form fields onChange Events to a single Callback
Stars: ✭ 25 (-35.9%)
Mutual labels:  preact, preact-components
preact-mdc
material design components for preact using material-components-web sass styles (for live demo click the link below)
Stars: ✭ 23 (-41.03%)
Mutual labels:  preact, preact-components
preact-perf-profiler
A HOC to enable measuring rendering performance for Preact components
Stars: ✭ 18 (-53.85%)
Mutual labels:  preact, preact-components
preact-token-input
🔖 A text field that tokenizes input, for things like tags.
Stars: ✭ 57 (+46.15%)
Mutual labels:  preact, preact-components
preact-polka-ssr
Preact SSR using Polka
Stars: ✭ 27 (-30.77%)
Mutual labels:  preact, preact-router
go-reverse-proxy
Reverse proxy with simple routing configuration and override behaviour
Stars: ✭ 21 (-46.15%)
Mutual labels:  routing
Dimensions
The load-balancing and routing service for Terraria Servers
Stars: ✭ 32 (-17.95%)
Mutual labels:  routing
urltree
Named URL data structure with support for URL building.
Stars: ✭ 36 (-7.69%)
Mutual labels:  routing
r2
A minimalist HTTP request routing helper for Go.
Stars: ✭ 32 (-17.95%)
Mutual labels:  routing
ors-map-client
Openrouteservice API web SPA client using VueJS, Vuetify and Vue2Leaflet
Stars: ✭ 51 (+30.77%)
Mutual labels:  routing
router
Bidirectional Ring router. REST oriented. Rails inspired.
Stars: ✭ 78 (+100%)
Mutual labels:  routing
OpenBSDFirewall
Simple OpenBSD Home Firewall Config for ALIX Board
Stars: ✭ 41 (+5.13%)
Mutual labels:  routing
csgo-rcon-nodejs
A web panel to control a CS:GO server
Stars: ✭ 46 (+17.95%)
Mutual labels:  preact
STCRouter
基于标准URL的iOS路由系统,可实现业务模块组件化,控制器之间零耦合,可实现黑白名单控制,可进行native降级到hybrid。
Stars: ✭ 19 (-51.28%)
Mutual labels:  routing
openmessaging.github.io
OpenMessaging homepage
Stars: ✭ 12 (-69.23%)
Mutual labels:  routing
stoxy
Stoxy is a state management API for all modern Web Technologies
Stars: ✭ 73 (+87.18%)
Mutual labels:  preact

preact-views

NPM travis-ci

Named views for Preact, with easy-as-pie linking between them!

preact-views provides a <Views /> component that renders its children only when their name prop is selected as the current "view". The current view name can be set via a prop, or automatically through the provided <Link /> component.

Note: preact-views is simple and does not do orchestration or routing for you. If you're looking for a URL router, try preact-router.

See a Real-world Example ➡️


Complete Example

import { Views, Link } from 'preact-views';
import { h, render } from 'preact';

const Home = () => (
	<div>
		<h1>Home!</h1>
		<Link to="other" params={{ value:1 }}>Go Other</Link>
	</div>
);

const Other = ({ value=0 }) => (
	<div>
		<h1>Other.</h1>
		<Link to="home">Go Home</Link>
		<p>value is {value}.</p>
		<Link to="other" params={{ value: value+1 }}>Increment</Link>
	</div>
);

render((
	<Views view="home">
		<Home name="home" />
		<Other name="other" />
	</Views>
), document.body);

See it running ➡️


Simple Example

import Views from 'preact-views';
import { h, render } from 'preact';

render((
	<Views view="one">
		<div name="one">one</div>
		<div name="two">two</div>
	</Views>
), document.body);

// renders a div containing the text "one"

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].