Guernsey is a British crown dependency but is not part of the UK or of the European Union .