Block / Content Block - 图1

Block Svelte Component

Block Svelte component represents Block / Content Block element designed (mostly) to add extra formatting and required spacing for text content.

Block Components

There are following components included:

  • Block - main block element
  • BlockTitle - block title. Can be used before Block or List View
  • BlockHeader - extra header element. Can be used both inside and outside of block elements
  • BlockFooter - extra footer element. Can be used both inside and outside of block elements

Block Properties

PropTypeDefaultDescription
<Block> properties
insetbooleanMakes block inset
xsmallInsetbooleanMakes block inset when app width >= 480px
smallInsetbooleanMakes block inset when app width >= 568px
mediumInsetbooleanMakes block inset when app width >= 768px
largeInsetbooleanMakes block inset when app width >= 1024px
xlargeInsetbooleanMakes block inset when app width >= 1200px
strongbooleanAdds extra highlighting and padding block content
accordionListbooleanMakes block wrapper for accordion items
tabsbooleanAdds additional “tabs” class to make the block tabs wrapper
tabbooleanAdds additional “tab” class when block should be used as a Tab
tabActivebooleanAdds additional “tab-active” class when block used as a Tab and makes it active tab
noHairlinesbooleanRemoves outer hairlines
noHairlinesMdbooleanRemoves outer hairlines for MD theme
noHairlinesIosbooleanRemoves outer hairlines for iOS theme
<BlockTitle> properties
mediumbooleanMakes block title medium size
largebooleanMakes block title large size

Examples

  1. <Page>
  2. <Navbar title="Content Block"></Navbar>
  3. <p>This paragraph is outside of content block. Not cool, but useful for any custom elements with custom styling.</p>
  4. <Block>
  5. <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  6. </Block>
  7. <Block strong>
  8. <p>Here comes another text block with additional "block-strong" class. Praesent nec imperdiet diam. Maecenas vel lectus porttitor, consectetur magna nec, viverra sem. Aliquam sed risus dolor. Morbi tincidunt ut libero id sodales. Integer blandit varius nisi quis consectetur. </p>
  9. </Block>
  10. <BlockTitle>Block title</BlockTitle>
  11. <Block>
  12. <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  13. </Block>
  14. <BlockTitle>Another ultra long content block title</BlockTitle>
  15. <Block strong>
  16. <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  17. </Block>
  18. <BlockTitle>Inset</BlockTitle>
  19. <Block strong inset>
  20. <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  21. </Block>
  22. <BlockTitle>Tablet Inset</BlockTitle>
  23. <Block strong mediumInset>
  24. <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  25. </Block>
  26. <BlockTitle>With Header & Footer</BlockTitle>
  27. <Block>
  28. <BlockHeader>Block Header</BlockHeader>
  29. <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  30. <BlockFooter>Block Footer</BlockFooter>
  31. </Block>
  32. <BlockHeader>Block Header</BlockHeader>
  33. <Block>
  34. <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  35. </Block>
  36. <BlockFooter>Block Footer</BlockFooter>
  37. <Block strong>
  38. <BlockHeader>Block Header</BlockHeader>
  39. <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  40. <BlockFooter>Block Footer</BlockFooter>
  41. </Block>
  42. <BlockHeader>Block Header</BlockHeader>
  43. <Block strong>
  44. <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  45. </Block>
  46. <BlockFooter>Block Footer</BlockFooter>
  47. <BlockTitle large>Block Title Large</BlockTitle>
  48. <Block strong>
  49. <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  50. </Block>
  51. <BlockTitle medium>Block Title Medium</BlockTitle>
  52. <Block strong>
  53. <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p>
  54. </Block>
  55. </Page>
  56. <script>
  57. import {Page, Navbar, Block, BlockTitle, BlockHeader, BlockFooter} from 'framework7-svelte';
  58. </script>

← Badge

Button →