Visual effect
<visual-effect> draws one of the system's materials behind its children. On macOS it is an
NSVisualEffectView: with its default behind-window blending, what is behind the window shows
through it, blurred and tinted, as it does through a source list's sidebar. A window can have that
look without a <split-view>, round a layout of its own:
import { VisualEffect } from '@ng-native/components';
<visual-effect> once VisualEffect is in the component's imports<visual-effect class="window" material="sidebar">
<view class="sidebar">...</view>
<view class="card">...</view>
</visual-effect>.window {
flex: 1;
flex-direction: row;
background-color: #f3f2f2;
}
.card {
flex: 1;
margin: 8px;
border-radius: 10px;
background-color: #ffffff;
}Import VisualEffect from @ng-native/components. It lays out and takes styles as a <view> does,
and its border-radius rounds the material. Content in it draws over the material, so a card with
a background of its own stays opaque.
On Linux, iOS and Android it is a plain view, and none of the material's props reach native: give
it a background-color, as above, for those, which macOS draws under the material.
Inputs
material: one of AppKit's materials, by the name of itsNSVisualEffectMaterialcase:sidebar(the default),window-background,under-window-background,content-background,under-page-background,header-view,titlebar,menu,popover,sheet,hud-window,full-screen-ui,tooltiporselection. A name it does not know drawssidebar.blendingMode:behind-window(the default) blurs the desktop and the windows behind the window;within-windowblurs the window's own content under the view.state:follows-window(the default) looks active while the window is key and inactive otherwise, as a sidebar does;activeandinactivekeep one look.emphasized: draws theselectionmaterial in the accent colour, as a source list's focused selection is.
A behind-window material shows the desktop only where nothing opaque is above it in the window, so
leave the root and the views between it and the <visual-effect> without a background of their
own on macOS.
Reference
visual-effectdirective@ng-native/componentsimport { VisualEffect } from '@ng-native/components';and add VisualEffect to the component's importsA view in one of the system's translucent materials, behind its children:
Inputs
materialVisualEffectMaterial The material. Defaults to sidebar .
blendingModeVisualEffectBlendingMode What the material blurs. Defaults to behind-window .
stateVisualEffectState Whether it looks active. Defaults to follows-window .
emphasizedunknownA selection material drawn in the accent colour, as a source list's focused selection is.
Compatibility
| iOS | Android | macOS | Linux | Web |
|---|---|---|---|---|
| plain view | plain view | NSVisualEffectView | plain view | plain view |